Skip to content

Use native AOT toolchain to reduce binary size#13

Open
JasonWei512 wants to merge 1 commit intoimbushuo:masterfrom
JasonWei512:native-aot
Open

Use native AOT toolchain to reduce binary size#13
JasonWei512 wants to merge 1 commit intoimbushuo:masterfrom
JasonWei512:native-aot

Conversation

@JasonWei512
Copy link
Copy Markdown

Replace ReadToRun with native AOT compiler to reduce binary size.

Before After Smaller
Binary Size 14.4 MB 4.2 MB 70%
Memory Usage 4.0 MB 1.4 MB 65%

Tested on both GitHub Actions and Azure Pipelines.

Works with features/config branch where System.Text.Json is used, which uses reflection.

Build requirements:

  • Windows SDK
  • Microsoft.VisualStudio.Component.VC.Tools.x86.x64
  • Microsoft.VisualStudio.Component.VC.Tools.ARM64

Build commands:

dotnet publish -c Release -r win-x64 --self-contained true
dotnet publish -c Release -r win-arm64 --self-contained true

@LifeIsStrange
Copy link
Copy Markdown

Same comment as for the other PR:
AOT has lower throughput and energy efficiency than JIT. Therefore it should not be the default user experience.
Can make sense for people that have extremely small disk space though but very niche.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants